# GHG Emissions Inverse Modeling

General idea is to have the inverse modeling engine apart from the campaign. This engine is maintained by inverse modeling experts. 
The user only addapts the "Run_Inversion.R" file according to his campaign. This file is located in the campaign folder with a folder structure given in the example_campaign

### First Installation:
- get latest git-respository: https://gitlab.lrz.de/00000000014A91A9/inverse-modeling.git
- adapt in "example_campaign\Run_Inversion.R" the path_inverse_modeling_engine. It sould be the absolute path to the inverse_modeling_engine folder.
- Install according packages: in RStudio there is a small message above the opended source-code "install all packages".
- Install remaining packages manually: in RStudio: lower right window: Packages->Install->search.
- have fun!



Inverse modeling of Greenhouse Gas (GHG) emissions using a top-down approach.  
### Inputs

All input-files should have the following format:
	XX_YYMMDD_ZZZZ.ZZ
	- XX denotes the campaign prefix (e.g. MUC for munich)
	- YYMMDD denotes the date of measurement (UTC)
	- ZZZZ.ZZ denotes additional information and file format (e.g. ERA2_bw8.nc)

- emission estimates (_a priori_ fluxes, from emission inventories)
- XCH4 observations (column-averaged mole fractions)
- footprints (sensitivity of receptor to emissions)

### Outputs
Direct model outputs are (_a posteriori_ estimates):
- scaling factors (per sector[^1])
- background time series vector

From the _a posteriori_ scaling factors and the _a priori_ emission inventory fluxes, the final model output can be calculated:
- emission estimates (_a posteriori_)

### Model validation
Through coefficient of determination (R^2) analysis between _a posteriori_ forward model and observations.

-------
[^1]: A "sector" specifies the type of emission source (e.g. _Public Power_, _Industry_, _Fugitives_, _Waste_, ...), it is **not** a grid cell in the domain.


## again a test